import urllib.request

url = 'http://fanyi.youdao.com/translate?smartresult=dict&smartresult=rule'
dataValue = {
    'i': '苹果',
    'from': 'AUTO',
    'to': 'AUTO',
    'smartresult': 'dict',
    'client': 'fanyideskweb',
    'salt': '16468120923946',
    'sign': '3192797d514780b9ec654c7ad886a094',
    'lts': '1646812092394',
    'bv': '6ea3c8fa8c34ed9c526a7795290401ab',
    'doctype': 'json',
    'version': '2.1',
    'keyfrom': 'fanyi.web',
    'action': 'FY_BY_REALTlME',
}

dataValue = urllib.parse.urlencode(dataValue).encode('utf-8')
response = urllib.request.urlopen(url, data=dataValue)
resp = response.read().decode('utf-8')
print('响应类型：', type(response))
print('响应状态码：', response.getcode())
print('响应内容：', resp)
